﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YAPL.Language.Core.Types {

	/// <summary>
	/// Attribute for function parameter definition. Should be applied to 'Call' method of any YAPLFunction
	/// </summary>
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
	public class ParamAttribute : Attribute, IComparable<ParamAttribute> {
		private readonly int _paramNumber;
		private readonly string _paramName;
		public ParamAttribute(int paramNumber, string paramName) {
			_paramNumber = paramNumber;
			_paramName = paramName;
		}

		public int ParamNumber {
			get { return _paramNumber; }
		}

		public string ParamName {
			get { return _paramName; }
		}

		public int CompareTo(ParamAttribute other) {
			return _paramNumber.CompareTo(other._paramNumber);
		}
	}
}
